package structureType.decorator.stream;

import java.util.*;

public class MMemory {
	private List<Object> memory = new ArrayList<Object>();
	private int max;
	public void put(Object o){
		if(checkSize()){
			this.memory.add(o);
		}
		else{
			System.out.println("Sorry... memory is full");
		}
	}
	public String getMemory(){
		String show = null;
		for(Object o :memory){
			show = show + o.toString();
		}
		return show;
	}
	private Boolean checkSize(){
		if(this.memory.size() > this.max)
			return false;
		return true;
	}
}
